package com.kaifamiao.listener;

import org.tinylog.Logger;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;

public class RequestListener implements ServletRequestListener {

    // 每次成功创建请求对象都会调用此方法
    @Override
    public void requestInitialized(ServletRequestEvent event) {
        ServletRequest req = event.getServletRequest();
        Logger.trace("创建请求对象: " + req );
    }

    // 每次成功销毁请求对象都会调用此方法
    @Override
    public void requestDestroyed(ServletRequestEvent event) {
        ServletRequest req = event.getServletRequest();
        Logger.trace("销毁请求对象: " + req );
    }

}
